<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>
<h1>购物车详细</h1>

<table cellpadding="10" cellspacing="0">
  <tr class="carttitle">

    <td>描述</td>
    <td>数量</td>
    <td>单价</td>
    <td>金额</td>
  </tr>
  <%
  for item in @items
    product = item.product
    -%>
    <tr>
      <td><%= h(product.title) %></td>
      <td><%= item.quantity %></td>
      <td align="right"><%=  number_to_currency(item.total_price) %></td>
      <td align="right"><%= number_to_currency(item.total_price * item.quantity) %></td>
    </tr>
  <% end %>
  <tr>
    <td colspan="3" align="right"><strong>汇总：</strong></td>
    <td id="totalcell"><%= number_to_currency(@cart.total_price) %></td>
  </tr>
</table>
<div id="cartmenu">
  <ul>
    <li><%= link_to '继续购物', :action => "index" %></li>
    <% unless params[:context] == :checkout -%>
      <li><%= link_to '清空', :action => "empty_cart" %></li>
      <li><%= link_to '确认订单', :action => "checkout" %></li>
    <% end -%>
  </ul>
</div>

